/**
 * 
 */
package ar.com.greensoft.neo.model;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import org.hibernate.envers.Audited;

import ar.com.greensoft.neo.model.references.ISO3166_1;

/**
 * 
 * @author Jorge E. Villaverde
 * @since 24/01/2012
 * @version 1.0.0
 */
@Entity
@Table(name="pais")
@Inheritance(strategy=InheritanceType.JOINED)
@NamedQueries({
	@NamedQuery(name=Pais.FIND_ALL_QUERY_NAME, query="SELECT p FROM Pais p ORDER BY p.name"),
	@NamedQuery(name=Pais.FIND_LIKE_NAME_QUERY_NAME, query="SELECT p FROM Pais p WHERE p.name LIKE :name"),
	@NamedQuery(name=Pais.FIND_BY_NAME_QUERY_NAME, query="SELECT p FROM Pais p WHERE p.name = :name"),
	@NamedQuery(name=Pais.FIND_BY_ISO_QUERY_NAME, query="SELECT p FROM Pais p WHERE p.codigoISO = :codigoISO"),
	@NamedQuery(name=Pais.COUNT_QUERY_NAME,    query="SELECT COUNT(p) FROM Pais p")
})
@Audited
public class Pais extends NamedEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public static final String FIND_LIKE_NAME_QUERY_NAME = "Pais.findNameLike";
	public static final String FIND_ALL_QUERY_NAME = "Pais.findAll";
	public static final String FIND_BY_NAME_QUERY_NAME = "Pais.findByName";
	public static final String FIND_BY_ISO_QUERY_NAME = "Pais.findByISO";
	public static final String COUNT_QUERY_NAME = "Pais.count";

	/**
	 * C&oacute;digo ISO de la Paises
	 */
	@Enumerated(EnumType.STRING)
	private ISO3166_1 codigoISO;

	public ISO3166_1 getCodigoISO() {
		return codigoISO;
	}

	public void setCodigoISO(ISO3166_1 codigoISO) {
		this.codigoISO = codigoISO;
	}	
	
}
